package com.jmga.ecogasfinder.vo;

import java.io.Serializable;
import java.util.Date;

public class GasStation implements Serializable {
	private static final long serialVersionUID = 1L;
	private String label;
	private String operator;
	private String address;
	private String lane;
	private String postalCode;
	private String province;
	private String locality;
	private Date date;
	private String saleType;
	private String sentType;
	private String xCoord;
	private String yCoord;
	private String xkey;
	private float price;
	
	public GasStation(String label, String operator, String address,
			String lane, String postalCode, String province,
			String locality, Date date, String saleType, String sentType,
			String xCoord, String yCoord, String xkey, float price) {
		this.label = label;
		this.operator = operator;
		this.address = address;
		this.lane = lane;
		this.postalCode = postalCode;
		this.province = province;
		this.locality = locality;
		this.date = date;
		this.saleType = saleType;
		this.sentType = sentType;
		this.xCoord = xCoord;
		this.yCoord = yCoord;
		this.xkey = xkey;
		this.price = price;
	}
	public String getLabel() {
		return this.label;
	}
	public String getOperator() {
		return this.operator;
	}
	public String getAddress() {
		return this.address;
	}
	public String getLane() {
		return this.lane;
	}
	public String getPostalCode() {
		return this.postalCode;
	}
	public String getProvincie() {
		return this.province;
	}
	public String getLocality() {
		return this.locality;
	}
	public Date getDate() {
		return this.date;
	}
	public String getSaleType() {
		return this.saleType;
	}
	public String getSentType() {
		return this.sentType;
	}
	
	public String getXCoord() {
		return this.xCoord;
	}
	
	public String getYCoord() {
		return this.yCoord;
	}
	
	public String getXkey() {
		return this.xkey;
	}
	
	public float getPrice() {
		return this.price;
	}
	
	@Override
	public String toString() {
	    return this.label;	  
	}

	@Override
	public boolean equals(Object o) {
		boolean result = false, equalXCoord, equalYCoord, equalXkey;
		
		if(o != null && o instanceof GasStation) {
			GasStation gasStation = (GasStation) o;
			equalXCoord = this.getXCoord().equals(gasStation.getXCoord());
			equalYCoord = this.getYCoord().equals(gasStation.getYCoord());
			equalXkey = this.getXkey().equals(gasStation.getXkey());

			result = equalXCoord && equalYCoord && equalXkey;	
		}
		
		return result;
	}
}
